<%@ page import="java.net.URLEncoder" %><%--
  Created by IntelliJ IDEA.
  User: 范军建
  Date: 2022/3/28
  Time: 18:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    request.setCharacterEncoding("utf-8");
    response.setCharacterEncoding("utf-8");
    String user= request.getParameter("user");
    String pass= request.getParameter("pass");
    if (user.equals("admin")&&pass.equals("1234")){
        request.setAttribute("succ","登录成功");
       /* System.out.println("用户名为：" + user);
        System.out.println("用户名密码为：" + pass);
*/

        request.getRequestDispatcher("chenggong.jsp").forward(request,response);
    }else {
        String flag = URLEncoder.encode("登录失败:用户名不存在或用户密码错误","utf-8");
        response.sendRedirect(request.getContextPath() + "/longin.jsp?info="+flag );
    }


%>

</body>
</html>
